package com.estun.backroundManagementService.modules.workOrder.service;// ScheduleService.java

import com.baomidou.mybatisplus.extension.service.IService;
import com.estun.backroundManagementService.domain.BaseResponse;
import com.estun.backroundManagementService.domain.factoryMes.request.base.BaseMesRequest;
import com.estun.backroundManagementService.domain.factoryMes.FactoryMesResponse;
import com.estun.backroundManagementService.enums.WorkOrderStatusEnum;
import com.estun.backroundManagementService.modules.workOrder.dto.WorkOrderEntity;


public interface WorkOrderService extends IService<WorkOrderEntity> {


    /**
     * 工单推送接口
     * 工厂mes调用产线mes
     *
     * @param request 工单信息
     * @return 推送结果
     */
    FactoryMesResponse push(BaseMesRequest<WorkOrderEntity> request);

    /**
     * 更新
     */
    BaseResponse updateScheduleStatus(WorkOrderEntity workOrder, WorkOrderStatusEnum statusEnum);


    /**
     * 自动刷新排程
     * 如果 当前没有运行中的排程 按照排程开始时间排序 开始一个排程
     */
    BaseResponse autoBeginSchedule();

    BaseResponse updateScheduleQty();


    WorkOrderEntity getInProcessSchedule();

    /**
     * 获取进行中主排程对应的虚拟排程
     */
    WorkOrderEntity getInProcessXpcSchedule();

    WorkOrderEntity getByScheduleCode(String scheduleCode);
}
